import { Modal, Tag, Drawer, Button } from 'antd'
import ExcelTable from '@components/exportExcel'
import LogForm from '@/pages/setting/logManage/components/LogForm'
import { useRef, useState } from 'react'
import { ActionType, ProFormInstance } from '@ant-design/pro-components'

const GroupMessage: React.FC = () => {
  useRef<ActionType>()
  useRef<ProFormInstance>()
  return (
    <ExcelTable
      requestFn={ params => {
        return {
          'code': 200,
          'message': '操作成功',
          'data': {
            'pageNum': 1,
            'pageSize': 20,
            'totalPage': 1,
            'total': 3,
            'list': [
              {
                createTime: '2022-02-20 13:50:15',
                person: 'admin',
                type: '1',
                mode: '首页',
                content: '用户信息-修改用户信息',
                ip: '【中国/成都】192.168.1.1',
              },
              {
                createTime: '2022-02-20 13:50:15',
                person: 'admin',
                type: '1',
                mode: '首页',
                content: '用户信息-修改用户信息',
                ip: '【中国/成都】192.168.1.1',
              },
              {
                createTime: '2022-02-20 13:50:15',
                person: 'admin',
                type: '1',
                mode: '首页',
                content: '用户信息-修改用户信息',
                ip: '【中国/成都】192.168.1.1',
              }
            ]
          }
        }
      }}
      rowSelection={false}
      toolBarRenderFn={() => []}
      columns={[
        {
          title: '发送者',
          dataIndex: 'keyword5',
          hideInTable: true,
          valueType: 'select',
          valueEnum: {
            all: '全部'
          }
        },
        {
          title: '消息类型',
          dataIndex: 'keyword7',
          hideInTable: true,
          valueType: 'select',
          valueEnum: {
            all: '全部'
          }
        },
        {
          title: '发送时间',
          dataIndex: 'keyword9',
          valueType: 'dateRange',
          hideInTable: true
        },
        {
          title: '会话类型',
          dataIndex: 'keyword8',
          hideInTable: true,
          valueType: 'select',
          valueEnum: {
            all: '全部'
          }
        },
        /** search */
        {
          title: '序号',
          valueType: 'index',
          hideInSearch: true
        },
        {
          title: '群组',
          dataIndex: 'g',
          hideInSearch: true
        },
        {
          title: '内容',
          dataIndex: 'content',
          hideInSearch: true
        },
        {
          title: '消息类型',
          dataIndex: 'person',
          hideInSearch: true
        },
        {
          title: '群组人数',
          dataIndex: 'gn',
          hideInSearch: true
        },
        {
          title: '发送者',
          dataIndex: 'mode',
          hideInSearch: true
        },
        {
          title: '会话类型',
          dataIndex: 'ip',
          hideInSearch: true
        },
        {
          title: '发送时间',
          dataIndex: 'createTime',
          hideInSearch: true,
          valueType: 'dateTime'
        },
        {
          title: '操作',
          key: 'option',
          valueType: 'option',
          render: (_, record) => [
            <a key="delete" onClick={() => {
              Modal.warning({
                title: '提示',
                content: '确定撤回该消息吗?',
                okText: '确定',
                okCancel: true,
                onOk() {
                  console.log('Confirmed:onOk ')
                }
              })
            }}>撤回</a>
          ]
        }
      ]} />
  )
}

export default GroupMessage